/**
 * 
 */
package co.edu.udem.service.place;

import java.util.Arrays;
import java.util.List;

/**
 * @since 17/07/2012
 */
public enum PlaceType {

	PLACE_1(1, "Bloque"), PLACE_2(2, "Aula"), PLACE_3(
			3, "Laboratorio");

	int code;

	String name;

	PlaceType(int code, String name) {
		this.code = code;
		this.name = name;
	}

	public static List<PlaceType> getCodesAsList() {
		return Arrays.asList((new PlaceType[] {
				PlaceType.PLACE_1,
				PlaceType.PLACE_2,
				PlaceType.PLACE_3 }));
	}

	public static String getPlaceTypeDescriptionByCode(int code) {
		if (code == PLACE_1.getCode()) {
			return PLACE_1.getName();
		} else if (code == PLACE_2.getCode()) {
			return PLACE_2.getName();
		} else if (code == PLACE_3.getCode()) {
			return PLACE_3.getName();
		}
		return null;
	}

	/**
	 * @return the code
	 */
	public int getCode() {
		return code;
	}

	/**
	 * @param code
	 *            the code to set
	 */
	public void setCode(int code) {
		this.code = code;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

}